﻿using Common.Communal;
using ERP.Domain.CustomerSupplier;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Sell.Api.Read.Application.Command.ContractCommand;
using Sell.DTO;

namespace Sell.Api.Read.Controllers.Contracts
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ContractController : ControllerBase
    {

        private readonly IMediator mediator;
        public ContractController(IMediator _mediator)
        {
            mediator = _mediator;

        }
        /// <summary>
        /// 采购合同列表
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        [HttpGet]
        public async Task<ApiResult<ApiPaging<contractlistdto>>> Contractlist([FromQuery]ContractlistCommand request)
        {
           return await mediator.Send(request);
        }
    }
}
